import java.util.Date;

public class Main {

    public static void main(String[] args) {
        stop();
    }

    public static void a(){
        System.out.println("Hello World!");
        MyThread myThread = new MyThread();
        Thread threadA = new Thread(myThread,"A");
        Thread threadB = new Thread(myThread,"B");
        Thread threadC = new Thread(myThread,"C");
        Thread threadD = new Thread(myThread,"D");
        Thread threadE = new Thread(myThread,"E");
        threadA.start();
        threadB.start();
        threadC.start();
        threadD.start();
        threadE.start();
    }


    public static void login(){
        ALogin a = new ALogin();
        a.start();
        BLogin b = new BLogin();
        b.start();
    }

    public static void sleep(){
        System.out.println("bengin");

        SleepThread sleepThread = new SleepThread();
        Thread thread = new Thread(sleepThread,"a");
        thread.start();
        System.out.println("end");
    }

    public static void stop(){

        try {
            ThreadFor threadFor = new ThreadFor();
            threadFor.start();

            System.out.println("main"+new Date().getTime());
            Thread.sleep(100L);
            System.out.println("Thread.currentThread().getName()"+Thread.currentThread().getName());
            System.out.println("threadFor.getName()"+threadFor.getName());
            System.out.println("main2"+new Date().getTime());
//            System.out.println(Thread.interrupted());
            threadFor.interrupt();
            System.out.println("threadFor.interrupted()"+threadFor.interrupted());
            System.out.println("threadFor.isInterrupted()"+threadFor.isInterrupted());
            System.out.println("threadFor.isInterrupted()"+threadFor.isInterrupted());
            Thread.currentThread().interrupt();
            System.out.println("Thread.interrupted()"+threadFor.interrupted());
            System.out.println("Thread.interrupted()"+Thread.currentThread().isInterrupted());
            System.out.println("Thread.interrupted()"+Thread.interrupted());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
